package com.lunago.agent.controller;

import com.lunago.agent.constant.JsonResult;
import com.lunago.agent.pojo.entity.Topic;
import com.lunago.agent.service.TopicService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Slf4j
@RestController
@RequestMapping("/aichat")
@Api(tags = "查询常见话题")
public class TopicController {
    @Autowired
    @Qualifier("topicServiceImpl")
    TopicService topicService;

    @PostMapping("/topic")
    public JsonResult selectTopic(){
        List<Topic> list = topicService.selectTopic();
        return JsonResult.ok(list);
    }
}
